3.1335 \(\int \frac{A+B x}{(d+e x) (a+c x^2)} \, dx\)

Optimal. Leaf size=109 \[ \frac{\log \left (a+c x^2\right ) (B d-A e)}{2 \left (a e^2+c d^2\right )}-\frac{(B d-A e) \log (d+e x)}{a e^2+c d^2}+\frac{\tan ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a}}\right ) (a B e+A c d)}{\sqrt{a} \sqrt{c} \left (a e^2+c d^2\right )} \]

[Out]

((A*c*d + a*B*e)*ArcTan[(Sqrt[c]*x)/Sqrt[a]])/(Sqrt[a]*Sqrt[c]*(c*d^2 + a*e^2)) - ((B*d - A*e)*Log[d + e*x])/(
c*d^2 + a*e^2) + ((B*d - A*e)*Log[a + c*x^2])/(2*(c*d^2 + a*e^2))

________________________________________________________________________________________

Rubi [A]  time = 0.10618, antiderivative size = 109, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 22, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.182, Rules used = {801, 635, 205, 260} \[ \frac{\log \left (a+c x^2\right ) (B d-A e)}{2 \left (a e^2+c d^2\right )}-\frac{(B d-A e) \log (d+e x)}{a e^2+c d^2}+\frac{\tan ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a}}\right ) (a B e+A c d)}{\sqrt{a} \sqrt{c} \left (a e^2+c d^2\right )} \]

Antiderivative was successfully verified.

[In]

Int[(A + B*x)/((d + e*x)*(a + c*x^2)),x]

[Out]

((A*c*d + a*B*e)*ArcTan[(Sqrt[c]*x)/Sqrt[a]])/(Sqrt[a]*Sqrt[c]*(c*d^2 + a*e^2)) - ((B*d - A*e)*Log[d + e*x])/(
c*d^2 + a*e^2) + ((B*d - A*e)*Log[a + c*x^2])/(2*(c*d^2 + a*e^2))

Rule 801

Int[(((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_)))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Int[ExpandIntegrand[(
(d + e*x)^m*(f + g*x))/(a + c*x^2), x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[c*d^2 + a*e^2, 0] && Integer
Q[m]

Rule 635

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Dist[d, Int[1/(a + c*x^2), x], x] + Dist[e, Int[x/
(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] &&  !NiceSqrtQ[-(a*c)]

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 260

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rubi steps

\begin{align*} \int \frac{A+B x}{(d+e x) \left (a+c x^2\right )} \, dx &=\int \left (\frac{e (-B d+A e)}{\left (c d^2+a e^2\right ) (d+e x)}+\frac{A c d+a B e+c (B d-A e) x}{\left (c d^2+a e^2\right ) \left (a+c x^2\right )}\right ) \, dx\\ &=-\frac{(B d-A e) \log (d+e x)}{c d^2+a e^2}+\frac{\int \frac{A c d+a B e+c (B d-A e) x}{a+c x^2} \, dx}{c d^2+a e^2}\\ &=-\frac{(B d-A e) \log (d+e x)}{c d^2+a e^2}+\frac{(c (B d-A e)) \int \frac{x}{a+c x^2} \, dx}{c d^2+a e^2}+\frac{(A c d+a B e) \int \frac{1}{a+c x^2} \, dx}{c d^2+a e^2}\\ &=\frac{(A c d+a B e) \tan ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a}}\right )}{\sqrt{a} \sqrt{c} \left (c d^2+a e^2\right )}-\frac{(B d-A e) \log (d+e x)}{c d^2+a e^2}+\frac{(B d-A e) \log \left (a+c x^2\right )}{2 \left (c d^2+a e^2\right )}\\ \end{align*}

Mathematica [A]  time = 0.0674397, size = 91, normalized size = 0.83 \[ \frac{2 \tan ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a}}\right ) (a B e+A c d)-\sqrt{a} \sqrt{c} (B d-A e) \left (2 \log (d+e x)-\log \left (a+c x^2\right )\right )}{2 \sqrt{a} \sqrt{c} \left (a e^2+c d^2\right )} \]

Antiderivative was successfully verified.

[In]

Integrate[(A + B*x)/((d + e*x)*(a + c*x^2)),x]

[Out]

(2*(A*c*d + a*B*e)*ArcTan[(Sqrt[c]*x)/Sqrt[a]] - Sqrt[a]*Sqrt[c]*(B*d - A*e)*(2*Log[d + e*x] - Log[a + c*x^2])
)/(2*Sqrt[a]*Sqrt[c]*(c*d^2 + a*e^2))

________________________________________________________________________________________

Maple [A]  time = 0.005, size = 159, normalized size = 1.5 \begin{align*}{\frac{\ln \left ( ex+d \right ) Ae}{a{e}^{2}+c{d}^{2}}}-{\frac{\ln \left ( ex+d \right ) Bd}{a{e}^{2}+c{d}^{2}}}-{\frac{\ln \left ( c{x}^{2}+a \right ) Ae}{2\,a{e}^{2}+2\,c{d}^{2}}}+{\frac{\ln \left ( c{x}^{2}+a \right ) Bd}{2\,a{e}^{2}+2\,c{d}^{2}}}+{\frac{Acd}{a{e}^{2}+c{d}^{2}}\arctan \left ({cx{\frac{1}{\sqrt{ac}}}} \right ){\frac{1}{\sqrt{ac}}}}+{\frac{aBe}{a{e}^{2}+c{d}^{2}}\arctan \left ({cx{\frac{1}{\sqrt{ac}}}} \right ){\frac{1}{\sqrt{ac}}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((B*x+A)/(e*x+d)/(c*x^2+a),x)

[Out]

1/(a*e^2+c*d^2)*ln(e*x+d)*A*e-1/(a*e^2+c*d^2)*ln(e*x+d)*B*d-1/2/(a*e^2+c*d^2)*ln(c*x^2+a)*A*e+1/2/(a*e^2+c*d^2
)*ln(c*x^2+a)*B*d+1/(a*e^2+c*d^2)/(a*c)^(1/2)*arctan(x*c/(a*c)^(1/2))*A*c*d+1/(a*e^2+c*d^2)/(a*c)^(1/2)*arctan
(x*c/(a*c)^(1/2))*a*B*e

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)/(e*x+d)/(c*x^2+a),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 8.56581, size = 456, normalized size = 4.18 \begin{align*} \left [-\frac{{\left (A c d + B a e\right )} \sqrt{-a c} \log \left (\frac{c x^{2} - 2 \, \sqrt{-a c} x - a}{c x^{2} + a}\right ) -{\left (B a c d - A a c e\right )} \log \left (c x^{2} + a\right ) + 2 \,{\left (B a c d - A a c e\right )} \log \left (e x + d\right )}{2 \,{\left (a c^{2} d^{2} + a^{2} c e^{2}\right )}}, \frac{2 \,{\left (A c d + B a e\right )} \sqrt{a c} \arctan \left (\frac{\sqrt{a c} x}{a}\right ) +{\left (B a c d - A a c e\right )} \log \left (c x^{2} + a\right ) - 2 \,{\left (B a c d - A a c e\right )} \log \left (e x + d\right )}{2 \,{\left (a c^{2} d^{2} + a^{2} c e^{2}\right )}}\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)/(e*x+d)/(c*x^2+a),x, algorithm="fricas")

[Out]

[-1/2*((A*c*d + B*a*e)*sqrt(-a*c)*log((c*x^2 - 2*sqrt(-a*c)*x - a)/(c*x^2 + a)) - (B*a*c*d - A*a*c*e)*log(c*x^
2 + a) + 2*(B*a*c*d - A*a*c*e)*log(e*x + d))/(a*c^2*d^2 + a^2*c*e^2), 1/2*(2*(A*c*d + B*a*e)*sqrt(a*c)*arctan(
sqrt(a*c)*x/a) + (B*a*c*d - A*a*c*e)*log(c*x^2 + a) - 2*(B*a*c*d - A*a*c*e)*log(e*x + d))/(a*c^2*d^2 + a^2*c*e
^2)]

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)/(e*x+d)/(c*x**2+a),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.13114, size = 140, normalized size = 1.28 \begin{align*} \frac{{\left (B d - A e\right )} \log \left (c x^{2} + a\right )}{2 \,{\left (c d^{2} + a e^{2}\right )}} - \frac{{\left (B d e - A e^{2}\right )} \log \left ({\left | x e + d \right |}\right )}{c d^{2} e + a e^{3}} + \frac{{\left (A c d + B a e\right )} \arctan \left (\frac{c x}{\sqrt{a c}}\right )}{{\left (c d^{2} + a e^{2}\right )} \sqrt{a c}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)/(e*x+d)/(c*x^2+a),x, algorithm="giac")

[Out]

1/2*(B*d - A*e)*log(c*x^2 + a)/(c*d^2 + a*e^2) - (B*d*e - A*e^2)*log(abs(x*e + d))/(c*d^2*e + a*e^3) + (A*c*d
+ B*a*e)*arctan(c*x/sqrt(a*c))/((c*d^2 + a*e^2)*sqrt(a*c))